# Contributor: Johannes Matheis <jomat+alpinebuild@jmt.gr>
# Maintainer: Johannes Matheis <jomat+alpinebuild@jmt.gr>
pkgname=xdm
pkgver=1.1.12
pkgrel=2
pkgdesc="X Display Manager"
options="!check" # No testsuite
url="http://xorg.freedesktop.org/"
arch="all"
license="MIT"
depends="sessreg"
makedepends="linux-pam-dev libxmu-dev libxaw-dev"
subpackages="$pkgname-doc $pkgname-openrc"
source="
	$url/releases/individual/app/$pkgname-$pkgver.tar.bz2
	$pkgname.initd
	$pkgname.confd
	Xresources.alpinelinux
	Xresources.alpinelinux_old
	alpinelinux_old_blue_black.xpm
	alpinelinux_white_blue.xpm
"

build() {
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--enable-ipv6 \
		--with-xdmconfigdir=/etc/X11/$pkgname \
		--with-pam
	make
}

package() {
	make DESTDIR="$pkgdir" install

	install -Dm755 "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -Dm644 "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname

	install -D -m644 "$srcdir"/Xresources.alpinelinux \
		"$pkgdir"/etc/X11/$pkgname/Xresources.alpinelinux
	install -D -m644 "$srcdir"/Xresources.alpinelinux_old \
		"$pkgdir"/etc/X11/$pkgname/Xresources.alpinelinux_old
	install -D -m644 "$srcdir"/alpinelinux_old_blue_black.xpm \
		"$pkgdir"/etc/X11/$pkgname/pixmaps/alpinelinux_old_blue_black.xpm
	install -D -m644 "$srcdir"/alpinelinux_white_blue.xpm \
		"$pkgdir"/etc/X11/$pkgname/pixmaps/alpinelinux_white_blue.xpm
}

sha512sums="1a4be0a070ced5db8fda6fc74794c9f9ed0cb37fa440fda6a3a7652aff62dfc3d7ba68b9facf054671ebf0f4db2a0eec29d0aa3716e3407ccd5529bac3553bdb  xdm-1.1.12.tar.bz2
e5a1c62d1ce62f3db5ffe13313f74d91f416cd08495aa1c780c728a3c58dd92473a08317334050c91fbf22a2cf4037a23a5baf4c31b5143ed2fac56f1ccdaf2f  xdm.initd
9d08ee82afeb85e7d9e0a1013226a44bdbef8d6da227f5fef7734524861c41f0cdc9ba4616b2faaf3a8d4b16134115ed004bf0a5fcf71be7c6e13506fbcda95b  xdm.confd
2a9db579323d680b6b3d7a0377ea1140c8570870c4f06f2ecc5e0ec73233b3621e46823ff3f694d8fa296a4de83b4fd62c2635c3c6b413b613ebe83cba4cf033  Xresources.alpinelinux
5d667541fdb39bdbd637da45e05a243736af32b7aa75ce27f2bbf097bce2fad87932619b372ab03add29b0bef7dd8816eb89875fbf2426eba83978d720687d90  Xresources.alpinelinux_old
b55424fd9ea0970fdbecd11c1abecf41cad1a7ede03f38011f666ae4eed2a88def5ac364bdf4ebcac09fa66963ed534e85faff74fcd01e9f040229d999382472  alpinelinux_old_blue_black.xpm
3872c54ad6fd6aa6c893f5f950801ae079bb7b6d375a05ef2262eb244a96ea3e949ab3cd962e005acf957c9ad4d30caee4c3935d7864a196625e8bfed9bc5adf  alpinelinux_white_blue.xpm"
